"""yijiao_main URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Add an import:  from blog import urls as blog_urls
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
import os

from django.conf.urls import include, url
from django.conf.urls.static import static
from django.views.generic import TemplateView

urlpatterns = [
    # url(r'^admin/', include(admin.site.urls)),
    # url(r'^api/getcsrftoken', csrftokengen.getToken),
    url(r'^api/admin/', include('apps.admin.urls')),
    url(r'^api/student/', include('apps.student.urls')),
    url(r'^api/payment/', include('apps.payment.urls')),
    url(r'^api/sms/', include('apps.sms.urls')),
    url(r'^api/qiniu/', include('apps.qiniu.urls')),
    url(r'^api/cloud/', include('apps.cloud.urls')),
    url(r'^api/esign/', include('apps.esign.urls')),
    url(r'^api/withdrawal/', include('apps.gongmall.urls')),
    url(r'^api/order/', include('apps.doudian.urls')),
    # url(r'^api/checkin/', include('apps.checkin.urls')),
    # url(r'^api/feedback/', include('apps.feedback.urls')),
    # url(r'^api/utils/password/', include('apps.utils.password.urls')),
    # url(r'^api/device/', include('apps.device.urls')),
    # url(r'^api/general/', include('apps.general.urls')),
    # url(r'^api/es/', include('apps.es.urls')),
    url(r'^api/wechat/', include('apps.wechat.urls')),
    # url(r'^api/open/', include('apps.open.urls')),
    url(r'^student', TemplateView.as_view(template_name="resource/student/index.html", content_type="text/html")),
    # url(r'^weekly', TemplateView.as_view(template_name="resource/weekly/index.html", content_type="text/html")),
    # url(r'^mgr/(shipper|agent|publisher|merchant|dls|bee)/', TemplateView.as_view(
    #     template_name="resource/mgr/index.html", content_type="text/html")),
    # url(r'^retail', TemplateView.as_view(template_name="resource/retail/index.html", content_type="text/html")),
    # url(r'^statistics', TemplateView.as_view(template_name="resource/statistics/index.html",
    # content_type="text/html")),
    url(r'^$', TemplateView.as_view(template_name="index.html", content_type="text/html"))
]

ABSOLUTE_PATH = '/home/yjyx/yijiao_src/yijiao_main/static'

if os.path.exists(ABSOLUTE_PATH):
    urlpatterns += static("/", document_root=ABSOLUTE_PATH)
else:
    urlpatterns += static('/', document_root='./static')
